/*
 *Description:
 *User:laoHu
 *Created with Intellij IDEA 2025
 *Data:2025.07.31
 *Time:22:15
 */
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        //实例化：不带头，单向，非循换的单链表
        SingleNode singleNode = new SingleNode();
        //创建节点
        singleNode.creatNode();
        //调用头插法
        singleNode.firstAddNode(1);
        //尾插法
        singleNode.lastAddNode(78);
        //指定位置前插入
        singleNode.insertBefore(3,66);
        //移除指定元素
        singleNode.remove(78);
        singleNode.remove(1);
        singleNode.remove(66);
        //将指定元素全部移除
        singleNode.firstAddNode(1);
        singleNode.insertBefore(2,1);
        singleNode.lastAddNode(1);
        singleNode.allRemove(1);
        //打印
        System.out.println(singleNode.head);
        singleNode.display();
        //求大小
        System.out.println(singleNode.size());
        //判断是否存在某一个元素
        System.out.println(singleNode.contain(11));
        //将链表销毁
        singleNode.clear();
        singleNode.display();
    }
}